Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for http status code as a field #1574

Merged
merged 2 commits into from
Sep 21, 2017
Merged

Add support for http status code as a field #1574

merged 2 commits into from
Sep 21, 2017

Conversation

nathanielc
Copy link
Contributor

@nathanielc nathanielc commented Sep 19, 2017

Fixes #1569

  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated

} else {
err = errors.New("unknown error, use .captureResponse() to capture the HTTP response")
}
n.diag.Error("POST returned non 2xx status code", err, keyvalue.KV("code", strconv.Itoa(resp.StatusCode)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just now understood what you were saying here #1535 (comment) about making everything strings.

Copy link
Contributor

@desa desa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small comment. Other than that LGTM! 👍

} else {
err = errors.New("unknown error, use .captureResponse() to capture the HTTP response")
}
h.diag.WithContext(keyvalue.KV("code", strconv.Itoa(resp.StatusCode))).Error("POST returned non 2xx status code", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WithContext returns a new diagnostic. Might be worth it to change the Error method on Diagnostic to

Error(msg string, err error, ctx ...keyvalue.T)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@nathanielc nathanielc merged commit 932d11f into master Sep 21, 2017
nathanielc added a commit that referenced this pull request Sep 21, 2017
Add support for http status code as a field
@nathanielc nathanielc deleted the nc-post-code branch September 21, 2017 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants